3.5.50 \(\int (a+b \sec (c+d x)) \, dx\) [450]

Optimal. Leaf size=16 \[ a x+\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \]

[Out]

a*x+b*arctanh(sin(d*x+c))/d

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {3855} \begin {gather*} a x+\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[a + b*Sec[c + d*x],x]

[Out]

a*x + (b*ArcTanh[Sin[c + d*x]])/d

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int (a+b \sec (c+d x)) \, dx &=a x+b \int \sec (c+d x) \, dx\\ &=a x+\frac {b \tanh ^{-1}(\sin (c+d x))}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 16, normalized size = 1.00 \begin {gather*} a x+\frac {b \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[a + b*Sec[c + d*x],x]

[Out]

a*x + (b*ArcTanh[Sin[c + d*x]])/d

________________________________________________________________________________________

Maple [A]
time = 0.03, size = 24, normalized size = 1.50

method result size
default \(a x +\frac {b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(24\)
derivativedivides \(\frac {\left (d x +c \right ) a +b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) \(29\)
norman \(a x +\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {b \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) \(40\)
risch \(a x -\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) \(42\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a+b*sec(d*x+c),x,method=_RETURNVERBOSE)

[Out]

a*x+b/d*ln(sec(d*x+c)+tan(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.26, size = 23, normalized size = 1.44 \begin {gather*} a x + \frac {b \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sec(d*x+c),x, algorithm="maxima")

[Out]

a*x + b*log(sec(d*x + c) + tan(d*x + c))/d

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 36 vs. \(2 (16) = 32\).
time = 3.02, size = 36, normalized size = 2.25 \begin {gather*} \frac {2 \, a d x + b \log \left (\sin \left (d x + c\right ) + 1\right ) - b \log \left (-\sin \left (d x + c\right ) + 1\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sec(d*x+c),x, algorithm="fricas")

[Out]

1/2*(2*a*d*x + b*log(sin(d*x + c) + 1) - b*log(-sin(d*x + c) + 1))/d

________________________________________________________________________________________

Sympy [A]
time = 1.02, size = 41, normalized size = 2.56 \begin {gather*} a x + b \left (\begin {cases} \frac {\log {\left (\tan {\left (c + d x \right )} + \sec {\left (c + d x \right )} \right )}}{d} & \text {for}\: d \neq 0 \\\frac {x \left (\tan {\left (c \right )} \sec {\left (c \right )} + \sec ^{2}{\left (c \right )}\right )}{\tan {\left (c \right )} + \sec {\left (c \right )}} & \text {otherwise} \end {cases}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sec(d*x+c),x)

[Out]

a*x + b*Piecewise((log(tan(c + d*x) + sec(c + d*x))/d, Ne(d, 0)), (x*(tan(c)*sec(c) + sec(c)**2)/(tan(c) + sec
(c)), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 49 vs. \(2 (16) = 32\).
time = 0.43, size = 49, normalized size = 3.06 \begin {gather*} a x + \frac {b {\left (\log \left ({\left | \frac {1}{\sin \left (d x + c\right )} + \sin \left (d x + c\right ) + 2 \right |}\right ) - \log \left ({\left | \frac {1}{\sin \left (d x + c\right )} + \sin \left (d x + c\right ) - 2 \right |}\right )\right )}}{4 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*sec(d*x+c),x, algorithm="giac")

[Out]

a*x + 1/4*b*(log(abs(1/sin(d*x + c) + sin(d*x + c) + 2)) - log(abs(1/sin(d*x + c) + sin(d*x + c) - 2)))/d

________________________________________________________________________________________

Mupad [B]
time = 0.80, size = 57, normalized size = 3.56 \begin {gather*} \frac {2\,a\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {2\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a + b/cos(c + d*x),x)

[Out]

(2*a*atan(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d + (2*b*atanh(sin(c/2 + (d*x)/2)/cos(c/2 + (d*x)/2)))/d

________________________________________________________________________________________